public class nyuu {
    package com.example.demo;

import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

    @Controller
    public class UserController {

        @Autowired
        UserService userService;

        @Resource(name = "user2")
        User user;
        public void sayHi(){
            System.out.println("hi,UserController");
            userService.sayhi();
            System.out.println(user);
        }
    }

}
